<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/commons/taglibs.jsp"%>
<script>
	$(document).ready(function() {
		//聚焦第一个输入框
		$("#name").focus();
		//为inputForm注册validate函数
		$("#inputForm").validate({
			rules : {
				fullName : "required",
				age : "required",
				birthDay : "required",
				sex : "required",
				height : "required",
				weight : "required",
				consumer : "required",
				memo : "required"
			}
		});
		
		$(".datepicker").datepicker({
			dateFormat : "yy-mm-dd",
			monthNames : [ "- 01月", "- 02月", "- 03月", "- 04月", "- 05月", "- 06月", "- 07月", "- 08月", "- 09月", "- 10月", "- 11月", "- 12月" ],
			showMonthAfterYear : true
		});		
	});
</script>
<form:form id="inputForm" class="well form-inline" action="${ctx}/adoms/consumerKid/save" modelAttribute="consumerKid" method="POST">
	<form:hidden path="id"/>
	<table class="table table-striped table-bordered table-condensed">
		<thead>
			<i class="icon-flag"></i>
			<strong>消费者子女信息表单</strong>
		</thead>
		<tr>
			<td class="span2">宝宝姓名:</td>
			<td><form:input path="fullName" size="30" maxlength="80"/></td>
		</tr>
		<tr>
			<td>年龄:</td>
			<td><form:input path="age" size="30" maxlength="80" /></td>
		</tr>
		<tr>
			<td>出生日期/预产期:</td>
			<td><form:input path="birthDay" size="30" maxlength="80" cssClass="datepicker" /></td>
		</tr>
		<tr>
			<td>性别:</td>
			<td>
				<form:radiobutton path="sex" label="男" value="M"/>
				<form:radiobutton path="sex" label="女" value="F"/>			
			</td>
		</tr>
		<tr>
			<td>身高:</td>
			<td><form:input path="height" size="30" maxlength="80"  /></td>
		</tr>
		<tr>
			<td>体重:</td>
			<td><form:input path="weight" size="30" maxlength="80"  /></td>
		</tr>
		<tr>
			<td>父母姓名:</td>
			<td>
				<form:select path="consumer.id">					
					<form:options items="${consumers}" itemLabel="fullName" itemValue="id" size="30" maxlength="80" />
				</form:select>				
			</td>
		</tr>
		<tr>
			<td>备注:</td>
			<td><form:textarea path="memo" rows="4" cssClass="span6" /></td>
		</tr>
		<tr>
			<td colspan="2">
				<input class="btn" type="submit" value="提交" />
				&nbsp;
				<input class="btn" type="button" value="返回" back="back" />
			</td>
		</tr>
	</table>
</form:form>
